<?php
function dbExceptionCheck($result,$conn=null)
{
	if($conn==null)
	{
	 if(!$result || mysql_error())
		throw new Exception(mysql_error()); 
	return;	
	}
	
	$GLOBALS["varsx"]["mysql err"]=mysql_error($GLOBALS["varsx"]["conn"]);
//	print_r($GLOBALS["varsx"]["mysql err"]);
	 if(!$result)
		 throw new Exception('$rzt is empty.. mysql err:'. mysql_error($conn));
	 if( mysql_error($conn))
		throw new Exception(mysql_error($conn));
	 

}
/*function dbExceptionCheck($result)
{
	 if(!$result || mysql_error())
		throw new Exception(mysql_error()); 

}*/

function dbExceptionCheck2()
{
	 if(  mysql_error())
		throw new Exception(mysql_error()); 

}

function execFun($funname)
{
	if(function_exists($funname))
	{
		$GLOBALS["stack"][]="exec fun exist:".$funname;
		$funname();
	}
	else
	{
		$GLOBALS["stack"][]="exec fun not exist:".$funname;
		throw new Exception("the fun is not exist:"+$funname); 
	}
	
}
?>